# Contributor: Curt Tilmes <Curt.Tilmes@nasa.gov>
# Maintainer: Curt Tilmes <Curt.Tilmes@nasa.gov>
pkgname=nqp
pkgver=2020.07
pkgrel=0
pkgdesc="Not Quite Perl"
url="https://github.com/Raku/nqp"
arch="all !x86 !armhf !armv7 !s390x"
options="!archcheck" # Arch dependencies are embedded
license="Artistic-2.0"
depends="moarvm"
makedepends="perl-utils moarvm-dev libffi-dev"
subpackages="$pkgname-doc"
source="https://github.com/Raku/nqp/releases/download/$pkgver/nqp-$pkgver.tar.gz"

build() {
	perl Configure.pl --prefix=/usr --backends=moar
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
}

doc() {
	cd "$builddir"
	mkdir -p "$subpkgdir"/usr/share/doc/"$pkgname"
	for file in CREDITS LICENSE README.pod VERSION docs examples; do
		cp -r $file "$subpkgdir"/usr/share/doc/"$pkgname"
	done
}

sha512sums="70b8fa525abc5b6d0749b3e1f090ace60095517d78f9ec84425f12496e46454f89e8f5ea0cbdd77e5f891a6abaa894c9dbc7be955652dfde1cc8d034aec237d3  nqp-2020.07.tar.gz"
